
<template>
  <ul class="app-header-nav">
    <!-- <li v-for="(_rawValue, id) in tableData" :key="id"> -->
    <li>
      <RouterLink to="/"><a>首页</a></RouterLink>
      <RouterLink to="#"><a>居家生活</a></RouterLink>
      <RouterLink to="#"><a>服务生活</a></RouterLink>
      <RouterLink to="/shoes"><a>服饰鞋包</a></RouterLink>
      <RouterLink to="#"><a>美食酒水</a></RouterLink>
      <RouterLink to="#"><a>个护清洁</a></RouterLink>
      <RouterLink to="#"><a>母亲亲子</a></RouterLink>
      <RouterLink to="#"><a>运动旅行</a></RouterLink>
      <RouterLink to="#"><a>数据家电</a></RouterLink>
      <RouterLink to="#"><a>严选去球</a></RouterLink>
      <RouterLink to="#"><a>为你严选</a></RouterLink>
      <RouterLink to="#"><a>众筹</a></RouterLink>
    </li>
    <!-- 弹出层 -->
    <!-- <div class="layer">
        <ul>
          <li v-for="item in 5" :key="item">
            <a href="#">
              <img src="@/assets/logo.png" alt />
            </a>
            <div>商品名称</div>
          </li>
        </ul>
      </div> -->
    <!-- </li> -->
  </ul>
</template>

<script setup>
import { ref, onMounted } from 'vue';
import axios from 'axios';
import Router from '@/router';
// setup() {
const tableData = ref([])
function loadList() {
  axios.get('http://localhost:3001/label').then(res => {
    tableData.value = res.data
  })
}

onMounted(() => {
  loadList()

})


let list = ref([])
function add(id) {
  list.value = id

  list.value = Router.id
  console.log(list.value);
}

</script>

<style lang="less" scoped>
.app-header-nav {
  li {
    // position: relative;
    // float: left;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    font-weight: bold;
    height: 40px;
    line-height: 40px;

    // 选中高亮设置
    // .router-link-exact-active {
    //   color: @xtxColor;
    //   border-bottom: 2px solid @xtxColor;
    // }

    a {
      padding-bottom: 7px;
      font-size: 15px;
    }

    //划过
    a:hover {
      color: @xtxColor;
      border-bottom: 2px solid @xtxColor;
    }
  }

  .layer {
    position: absolute;
    left: 0;
    top: 40px;
    width: 1090px;
    height: 120px;
    background-color: #fff;
    box-shadow: 0 0 5px #ccc;
    padding: 10px;

    ul {
      li {
        height: 100px;

        a {
          border-bottom: 0;
        }

        img {
          width: 50px;
          height: 50px;
          text-align: center;
        }

        &:hover {
          background-color: #f7f7f7;
        }
      }
    }
  }
}
</style>